= field_set do
  - if f.object.new_record?
    - if params[:affair_id]
      - if f.object.is_a?(PurchasePayment)
        - f.object.affair = PurchaseAffair.find(params[:affair_id])
      - elsif f.object.is_a?(PayslipPayment)
        - f.object.affair = PayslipAffair.find(params[:affair_id])
    - if f.object.affair
      = f.association :affair, as: :hidden
  = f.referenced_association :payee
  = f.input :amount, as: :string, input_html: { pattern: "[0-9]+([\.][0-9]+)?" }
  = f.input :to_bank_at
  = f.input :delivered
  = f.referenced_association :mode
  = f.custom_fields

= field_set(:depositable_options) do
  = f.referenced_association :responsible, :source => :employees
  = f.input :paid_at
  = f.input :bank_check_number

= f.attachments_field_set
